﻿/*----------------------------------------------------------------
  //Copyright (C) 2012 赵国伟
  //文件功能描述：资讯管理
  //创建人：赵国伟
  //生成时间：2012/03/17 16:15:00
//----------------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Shopping.Common;
using Shopping.Model;
using Shopping.BLL;

public partial class Manage_NewsManage : BaseManagePage
{
    protected string SelectOptionOfCategory; //资讯类别选项；
    protected QueryNewsAsPage qo = new QueryNewsAsPage(); //资讯查询对象；
    protected List<NewsInfo> listOfNews;

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            qo.CategoryID = Utility.G<int>("CategoryID");
            qo.KeyWords = Utility.G("KeyWords");
            qo.Sorts = Utility.G<int>("Sorts");
            qo.Status = Utility.G("Status");
            qo.StartDate = Utility.G("StartDate");
            qo.EndDate = Utility.G("EndDate");
            qo.CurPage = Utility.G<int>("CurPage");

            if (qo.StartDate == "" && qo.EndDate == "")
            {
                qo.StartDate = DateTime.Now.AddYears(-1).ToString("yyyy-MM-dd");
                qo.EndDate = DateTime.Now.ToString("yyyy-MM-dd");
            }
            if (qo.CurPage <= 0)
                qo.CurPage = 1;

            SelectOptionOfCategory = NewsManage.GetCategoriesToSelectOption(false, qo.CategoryID.ToString());
            NewsManage bllNews = new NewsManage();
            listOfNews = bllNews.QueryNewsAsPage(qo);
        }
    }
}